import Vue from 'vue';
import App from './App.vue';
import store from './store';
import router from './router';
import permission from './utils/permission';
import { MAP_KEY, LICENSE_CODE } from '@/config/setting';
import EleAdmin from 'ele-admin';
import './styles/index.scss';
import VueClipboard from 'vue-clipboard2';
import i18n from './i18n';
import request from '@/utils/request';
import constant from '@/components/Constant/Constant.vue';
import signalR from '@/utils/signalR';
import * as echarts from 'echarts'
//全局引入大屏dataV组件
import dataV from '@jiaminghi/data-view'

// 解决请求时出现NavigationDuplicated问题
// import Router from 'vue-router'
// const routerPush = Router.prototype.push
// Router.prototype.push = function push(location) {
// return routerPush.call(this, location).catch(error=> error)
// }

Vue.prototype.$http = request;
Vue.prototype.Constant = constant;
Vue.config.productionTip = false;
Vue.prototype.signalR = signalR;
Vue.prototype.$echarts = echarts
Vue.use(EleAdmin, {
  response: {
    dataName: 'list'
  },
  mapKey: MAP_KEY,
  license: LICENSE_CODE,
  i18n: (key, value) => i18n.t(key, value)
});
Vue.use(dataV)
Vue.use(permission);

Vue.use(VueClipboard);

new Vue({
  router,
  store,
  i18n,
  render: (h) => h(App)
}).$mount('#app');
